<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>strip</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="language.modifiers.html" title="Chapter 5. Variable Modifiers">
<link rel="prev" href="language.modifier.string.format.html" title="string_format">
<link rel="next" href="language.modifier.strip.tags.html" title="strip_tags">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">strip</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.modifier.string.format.html">Prev</a> </td>
<th width="60%" align="center">Chapter 5. Variable Modifiers</th>
<td width="20%" align="right"> <a accesskey="n" href="language.modifier.strip.tags.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="strip">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.modifier.strip"></a>strip</h2></div></div></div>
<p>
   This replaces all repeated spaces, newlines and tabs with a single
   space, or with the supplied string.
  </p>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
    If you want to strip blocks of template text, use the built-in <a class="link" href="language.function.strip.html" title="{strip}"><code class="varname">{strip}</code></a> function.
   </p>
</div>
<div class="example">
<a name="id356191"></a><p class="title"><b>Example 5.19. strip</b></p>
<div class="example-contents">
<pre class="programlisting">

&lt;?php
$smarty-&gt;assign('articleTitle', "Grandmother of\neight makes\t    hole in one.");
$smarty-&gt;display('index.tpl');
?&gt;

   </pre>
<p>
    Where template is:
   </p>
<pre class="programlisting">

{$articleTitle}
{$articleTitle|strip}
{$articleTitle|strip:'&amp;nbsp;'}

   </pre>
<p>
    Will output:
   </p>
<pre class="screen">

Grandmother of
eight makes        hole in one.
Grandmother of eight makes hole in one.
Grandmother&amp;nbsp;of&amp;nbsp;eight&amp;nbsp;makes&amp;nbsp;hole&amp;nbsp;in&amp;nbsp;one.

   </pre>
</div>
</div>
<br class="example-break"><p>
     See also
     <a class="link" href="language.function.strip.html" title="{strip}"><code class="varname">{strip}</code></a>
     and
     <a class="link" href="language.modifier.truncate.html" title="truncate"><code class="varname">truncate</code></a>.
  </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.modifier.string.format.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.modifiers.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="language.modifier.strip.tags.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">string_format </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> strip_tags</td>
</tr>
</table>
</div>
</body>
</html>
